<template>
  <div id="accounts">
    <el-tabs v-model="activeName" class="demo-tabs">
      <el-tab-pane label="基本信息" name="first">
        <userInfo />
      </el-tab-pane>
      <el-tab-pane label="修改密码" name="second">
        <edit-password />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script setup>
import { ref } from 'vue';

import userInfo from './components/userInfo';
import editPassword from './components/EditPassWord';
import { useRoute } from 'vue-router';

const route = useRoute();
const handleChangeActiveName = () => {
  if (!route.query.type) {
    return;
  } else if (route.query.type == '1') {
    activeName.value = 'second';
  }
};

const activeName = ref('first');
handleChangeActiveName();
</script>

<style lang="scss" scoped>
#accounts {
  width: 100%;
}
</style>
